package lc;

public class Q2315 {

    public int countAsterisks(String s) {
        // 获取每一个竖线的位置
        char[] chars = s.toCharArray();
        boolean ignore = false;
        int result = 0;
        for (char aChar : chars) {
            if (aChar == '|') {
                ignore = !ignore;
            }
            if (!ignore && aChar == '*') {
                result++;
            }
        }
        return result;
    }

    public static void main(String[] args) {
        Q2315 q2315 = new Q2315();
        System.out.println(q2315.countAsterisks("l|*e*et|c**o|*de|"));
        System.out.println(q2315.countAsterisks("yo|uar|e**|b|e***au|tifu|l"));
    }
}
